Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing KeyObjects via postMessage #33360

Closed

Conversation

tniessen
Copy link
Member

This patch allows to pass KeyObject instances between threads/contexts, and is based on some great work by @addaleax.

While the public API has not changed, the internal structure has become a little complicated. In order to be cloneable, the KeyObject class must be implemented in C++. However, KeyObject relies on its JavaScript class hierarchy. To get around this problem, a new base class NativeKeyObject is added, from which all KeyObject classes inherit:

             +---------------------+
             |     BaseObject      |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |   NativeKeyObject   |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |      KeyObject      |
             +---------------------+
               /                 \
              /                   \
             /                     \
            /                       \
+---------------------+    +---------------------+
|   SecretKeyObject   |    | AsymmetricKeyObject |
+---------------------+    +---------------------+
                             /                 \
                            /                   \
                           /                     \
                          /                       \
              +---------------------+   +---------------------+
              |   PublicKeyObject   |   |   PrivateKeyObject  |
              +---------------------+   +---------------------+

NativeKeyObject has no properties and doesn't change the behavior of KeyObject. It only exists to be cloneable.

Each KeyObject k has an associated KeyObjectHandle, which is stored in k[kHandle]. The public KeyObject API uses the internal KeyObjectHandle API to perform most operations, however, a KeyObjectHandle is a BaseObject and cannot be shared between threads directly. Instead, each KeyObjectHandle references a KeyObjectData object, which contains the actual key. This object can be shared between threads:

+-----------------+
| NativeKeyObject |
+-----------------+
        ^
     extends
        |
+-----------------+    +-----------------+    +---------------+
| KeyObject  (JS) | -> | KeyObjectHandle | -> | KeyObjectData |
+-----------------+    +-----------------+    +---------------+

When a key is passed via a MessagePort, the receiver creates a new KeyObjectHandle and the correct KeyObject (one of SecretKeyObject, PublicKeyObject, PrivateKeyObject). However, it does not create a new KeyObjectData object: All threads always refer to the same KeyObjectData for the same key:

+-------------------+
| NativeKeyObject 1 | ------------------------------------------+
+-------------------+                                           |
        ^                                                       |
     extends                                                    |
        |                                                       |
+-------------------+    +-------------------+                  |
| KeyObject 1  (JS) | -> | KeyObjectHandle 1 | --------------+  |
+-------------------+    +-------------------+               |  |
                                                             |  |
                                                             |  |
                                                             |  |
                                                             |  |
                                                             |  |
+-------------------+                                        |  |
| NativeKeyObject 2 | ------------------------------------+  |  |
+-------------------+                                     |  |  |
        ^                                                 |  |  |
     extends                                              |  |  |
        |                                                 |  |  |
+-------------------+    +-------------------+            |  |  |
| KeyObject 2  (JS) | -> | KeyObjectHandle 2 | --------+  |  |  |
+-------------------+    +-------------------+         |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
+-------------------+                                  |  |  |  |
| NativeKeyObject 3 | ------------------------------+  |  |  |  |
+-------------------+                               |  |  |  |  |
        ^                                           |  |  |  |  |
     extends                                        |  |  |  |  |
        |                                           v  v  v  v  v
+-------------------+    +-------------------+    +---------------+
| KeyObject 3  (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData |
+-------------------+    +-------------------+    +---------------+

Since almost all operations go through the KeyObjectHandle, it makes sense for the KeyObjectHandle to contain a pointer to the KeyObjectData. However, the NativeKeyObject class implements CloneForMessaging and therefore also needs access to the same KeyObjectData. In theory, we could go through this[kHandle]->Data(), but it is easier to also maintain a pointer from the NativeKeyObject to the same KeyObjectData.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

cc @addaleax @panva @nodejs/crypto @nodejs/security-wg

@tniessen tniessen added crypto Issues and PRs related to the crypto subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. worker Issues and PRs related to Worker support. labels May 11, 2020
@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label May 11, 2020
doc/api/crypto.md Outdated Show resolved Hide resolved
doc/api/crypto.md Outdated Show resolved Hide resolved
assert(!(port2Moved instanceof Object));

port2Moved.onmessage = common.mustCall(({ data: { key } }) => {
assert.strictEqual(keyToString(key), repr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that key instanceof Object is true here, but port2Moved should only create objects in context and not in the outer/main context (see also the comment for TransferData::Deserialize()).

NativeKeyObject::KeyObjectTransferData::Deserialize() should either fail if context != env->context(), or env->crypto_key_object_secret_constructor() etc. need to be stored as templates instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give me a hint how to store the constructors as templates? I didn't think it was possible with classes defined in JavaScript :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, it’s not … I guess that means that you’ll have to throw an exception here if the contexts mismatch

(The alternative would be giving node_crypto multi-context support, but we’re not really quite there yet I’d say … and in any case, that would be a lot more work than this PR)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't quite figure out where to throw. Throwing in Deserialize compiles, but then how would the user catch it? It doesn't seem to cause an error event. Throwing in CloneForMessaging seems like the better choice to me, but that seems to be even more difficult (since it only happens in SerializerDelegate::Finish without access to the environment/context etc.). Do you have another hint for me? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm – Deserialize() would be the right place, yes. Maybe adding

  TryCatchScope try_catch(env());
  try_catch.SetVerbose(true);

after the Context::Scope context_scope(context); line in MessagePort::OnMessage() helps? It would still result in an uncaught exception, I think, but I’m not really sure what the alternative would be… there is onmessageerror on the Web MessagePort, but we’re not currently implementing that.

(I think even just discarding the message would also be fine as a step for now – really anything that does not result in an object being created in the wrong Context.)

src/node_messaging.cc Outdated Show resolved Hide resolved
@panva
Copy link
Member

panva commented May 12, 2020

@tniessen @addaleax thanks for taking my proposal into consideration. I've checked out the branch and did some initial testing.

The goal I had in mind for this is to have somewhat of an answer to #678. In my JOSE library I encourage developers to work with JWK key abstraction object instances that use crypto.KeyObject instances behind the scenes for clear performance gains when it comes to executing sign/verify/publicEncrypt/privateDecrypt ops with a repeated set of keys.

Still, depending on the [operation, algorithm, key type] in question the executed crypto can be really slow and most importantly blocking the thread.

Using the feature from this PR I can add an async interface that would unblock the main thread for operations that I know are going to be more expensive than the cost of a worker_thread message roundtrip without the need for crypto to completely re-parse the key before the op. It's a great optimization to what would otherwise be a waste of cpu cycles.

As you can see in my testing KeyObject instance transfer is always faster then key export and subsequent import in a worker thread.

The test doesn't run any crypto operation other than importing the key (in case of export-import) and then replying back to the main thread. ops/sec therefore observe the cost of key export(optional), sending a message, key import(optional), response.

What you can observe from the results is that keyobject transfer as more or less stable ops/sec where as export-import depends on the type of a key.

secret  transfer x 31,701 ops/sec ±4.30% (78 runs sampled)
secret   export-import x 27,923 ops/sec ±5.50% (76 runs sampled)

private rsa transfer x 30,459 ops/sec ±8.98% (79 runs sampled)
private rsa der export-import x 16,252 ops/sec ±1.72% (79 runs sampled)

public rsa transfer x 31,965 ops/sec ±3.18% (84 runs sampled)
public rsa der export-import x 19,767 ops/sec ±1.74% (79 runs sampled)

private ec transfer x 31,345 ops/sec ±4.23% (81 runs sampled)
private ec der export-import x 9,483 ops/sec ±1.32% (81 runs sampled)

public ec transfer x 31,025 ops/sec ±6.02% (83 runs sampled)
public ec der export-import x 10,384 ops/sec ±1.08% (83 runs sampled)

private ed25519 transfer x 30,734 ops/sec ±5.83% (82 runs sampled)
private ed25519 der export-import x 10,699 ops/sec ±0.95% (81 runs sampled)

public ed25519 transfer x 31,406 ops/sec ±5.35% (80 runs sampled)
public ed25519 der export-import x 22,013 ops/sec ±1.36% (81 runs sampled)

get symmetricKeySize() {
return this[kHandle].getSymmetricKeySize();
get type() {
return this[kKeyType];
Copy link
Member

@himself65 himself65 May 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use private filed? I wouldn't like to add an extra symbol which is only used once, in this simple class KeyObject

like:

  class KeyObject extends NativeKeyObject {
    #type

    constructor(type, handle) {
      super(checkKeyTypeAndHandle(type, handle) || handle);

      this.#type = type;

      ObjectDefineProperty(this, kHandle, {
        value: handle,
        enumerable: false,
        configurable: false,
        writable: false
      });
    }

    get type() {
      return this.#type;
    }
  }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pre-existing code, but I'll consider it. I guess the same is true for a lot of existing class fields in core.

@addaleax
Copy link
Member

@tniessen Let me know if you’d like me to rebase this, the conflicts are kind of my fault after all :)

@tniessen tniessen force-pushed the allow-keyobjects-in-postmessage branch from 53edb69 to 2c30a06 Compare June 18, 2020 10:33
@tniessen
Copy link
Member Author

@addaleax I rebased it, but either (a) there was a bug in this PR before, or (b) I broke something while rebasing this PR, or (c) something changed on the upstream branch that I didn't see.

Passing KeyObject instances to postMessage now throws:

DOMException [DataCloneError]: Cannot transfer object of unsupported type.

@tniessen
Copy link
Member Author

Also, I see that you added a JSTransferable class. Would it make more sense to use that instead of NativeKeyObject?

@addaleax
Copy link
Member

Also, I see that you added a JSTransferable class. Would it make more sense to use that instead of NativeKeyObject?

@tniessen Before #33772, it didn’t really occur to me that we could use that trick to make JS wrapper objects transferable. It may or may not be easier to keep going that route instead of changing the class structure here, but I think you can judge that better than me :)

As for the error … in CreateNativeKeyObject(), the FunctionTemplate doesn’t inherit from the BaseObject template. I think that was the place where I mentioned I was getting merge conflicts :)

(As a side note, you generally don’t want to create a new FunctionTemplate per object but rather use a single one, because V8 caches FunctionTemplates, so this would appear like a memory leak, similar to the one fixed by 978d89f.)

@tniessen tniessen force-pushed the allow-keyobjects-in-postmessage branch from 2c30a06 to 77d4b6c Compare June 18, 2020 12:02
@tniessen
Copy link
Member Author

tniessen commented Jun 18, 2020

As for the error … in CreateNativeKeyObject(), the FunctionTemplate doesn’t inherit from the BaseObject template. I think that was the place where I mentioned I was getting merge conflicts :)

Right, you mentioned that! Thank you :)

As a side note, you generally don’t want to create a new FunctionTemplate per object but rather use a single one, because V8 caches FunctionTemplates, so this would appear like a memory leak, similar to the one fixed by 978d89f.

@addaleax Could you clarify this? From my perspective, CreateNativeKeyObject creates the JS class NativeKeyObject (once), and creating instances of NativeKeyObject should not cause new FunctionTemplates to be created. (I have to admit, the name is misleading.)

@tniessen tniessen force-pushed the allow-keyobjects-in-postmessage branch from 77d4b6c to 946e996 Compare June 18, 2020 12:08
@addaleax
Copy link
Member

As a side note, you generally don’t want to create a new FunctionTemplate per object but rather use a single one, because V8 caches FunctionTemplates, so this would appear like a memory leak, similar to the one fixed by 978d89f.

@addaleax Could you clarify this? From my perspective, CreateNativeKeyObject creates the JS class NativeKeyObject (once), and creating instances of NativeKeyObject should not cause new FunctionTemplates to be created. (I have to admit, the name is misleading.)

Right, I was misled by the name to think that it would create one KeyObject object per call, not multiple classes :) Sorry!

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, LGTM!

src/node_crypto.cc Outdated Show resolved Hide resolved
             +---------------------+
             |     BaseObject      |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |   NativeKeyObject   |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |      KeyObject      |
             +---------------------+
               /                 \
              /                   \
             /                     \
            /                       \
+---------------------+    +---------------------+
|   SecretKeyObject   |    | AsymmetricKeyObject |
+---------------------+    +---------------------+
                             /                 \
                            /                   \
                           /                     \
                          /                       \
              +---------------------+   +---------------------+
              |   PublicKeyObject   |   |   PrivateKeyObject  |
              +---------------------+   +---------------------+
This separates key handles from the actual key data:

+-----------------+
| NativeKeyObject |
+-----------------+
        ^
     extends
        |
+-----------------+    +-----------------+    +---------------+
| KeyObject  (JS) | -> | KeyObjectHandle | -> | KeyObjectData |
+-----------------+    +-----------------+    +---------------+
@tniessen tniessen removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 19, 2020
addaleax pushed a commit that referenced this pull request Sep 27, 2020
PR-URL: #33360
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit that referenced this pull request Sep 27, 2020
             +---------------------+
             |     BaseObject      |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |   NativeKeyObject   |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |      KeyObject      |
             +---------------------+
               /                 \
              /                   \
             /                     \
            /                       \
+---------------------+    +---------------------+
|   SecretKeyObject   |    | AsymmetricKeyObject |
+---------------------+    +---------------------+
                             /                 \
                            /                   \
                           /                     \
                          /                       \
              +---------------------+   +---------------------+
              |   PublicKeyObject   |   |   PrivateKeyObject  |
              +---------------------+   +---------------------+

PR-URL: #33360
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit that referenced this pull request Sep 27, 2020
This separates key handles from the actual key data:

+-----------------+
| NativeKeyObject |
+-----------------+
        ^
     extends
        |
+-----------------+    +-----------------+    +---------------+
| KeyObject  (JS) | -> | KeyObjectHandle | -> | KeyObjectData |
+-----------------+    +-----------------+    +---------------+

PR-URL: #33360
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit that referenced this pull request Sep 27, 2020
This change allows sharing KeyObjects between threads via postMessage.
The receiver acquires a new KeyObject and a new KeyObjectHandle, but
refers to the same KeyObjectData:

+-------------------+
| NativeKeyObject 1 | ------------------------------------------+
+-------------------+                                           |
        ^                                                       |
     extends                                                    |
        |                                                       |
+-------------------+    +-------------------+                  |
| KeyObject 1  (JS) | -> | KeyObjectHandle 1 | --------------+  |
+-------------------+    +-------------------+               |  |
                                                             |  |
                                                             |  |
                                                             |  |
                                                             |  |
                                                             |  |
+-------------------+                                        |  |
| NativeKeyObject 2 | ------------------------------------+  |  |
+-------------------+                                     |  |  |
        ^                                                 |  |  |
     extends                                              |  |  |
        |                                                 |  |  |
+-------------------+    +-------------------+            |  |  |
| KeyObject 2  (JS) | -> | KeyObjectHandle 2 | --------+  |  |  |
+-------------------+    +-------------------+         |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
+-------------------+                                  |  |  |  |
| NativeKeyObject 3 | ------------------------------+  |  |  |  |
+-------------------+                               |  |  |  |  |
        ^                                           |  |  |  |  |
     extends                                        |  |  |  |  |
        |                                           v  v  v  v  v
+-------------------+    +-------------------+    +---------------+
| KeyObject 3  (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData |
+-------------------+    +-------------------+    +---------------+

Co-authored-by: Anna Henningsen <[email protected]>

PR-URL: #33360
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit that referenced this pull request Sep 28, 2020
PR-URL: #33360
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit that referenced this pull request Sep 28, 2020
             +---------------------+
             |     BaseObject      |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |   NativeKeyObject   |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |      KeyObject      |
             +---------------------+
               /                 \
              /                   \
             /                     \
            /                       \
+---------------------+    +---------------------+
|   SecretKeyObject   |    | AsymmetricKeyObject |
+---------------------+    +---------------------+
                             /                 \
                            /                   \
                           /                     \
                          /                       \
              +---------------------+   +---------------------+
              |   PublicKeyObject   |   |   PrivateKeyObject  |
              +---------------------+   +---------------------+

PR-URL: #33360
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit that referenced this pull request Sep 28, 2020
This separates key handles from the actual key data:

+-----------------+
| NativeKeyObject |
+-----------------+
        ^
     extends
        |
+-----------------+    +-----------------+    +---------------+
| KeyObject  (JS) | -> | KeyObjectHandle | -> | KeyObjectData |
+-----------------+    +-----------------+    +---------------+

PR-URL: #33360
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit that referenced this pull request Sep 28, 2020
This change allows sharing KeyObjects between threads via postMessage.
The receiver acquires a new KeyObject and a new KeyObjectHandle, but
refers to the same KeyObjectData:

+-------------------+
| NativeKeyObject 1 | ------------------------------------------+
+-------------------+                                           |
        ^                                                       |
     extends                                                    |
        |                                                       |
+-------------------+    +-------------------+                  |
| KeyObject 1  (JS) | -> | KeyObjectHandle 1 | --------------+  |
+-------------------+    +-------------------+               |  |
                                                             |  |
                                                             |  |
                                                             |  |
                                                             |  |
                                                             |  |
+-------------------+                                        |  |
| NativeKeyObject 2 | ------------------------------------+  |  |
+-------------------+                                     |  |  |
        ^                                                 |  |  |
     extends                                              |  |  |
        |                                                 |  |  |
+-------------------+    +-------------------+            |  |  |
| KeyObject 2  (JS) | -> | KeyObjectHandle 2 | --------+  |  |  |
+-------------------+    +-------------------+         |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
+-------------------+                                  |  |  |  |
| NativeKeyObject 3 | ------------------------------+  |  |  |  |
+-------------------+                               |  |  |  |  |
        ^                                           |  |  |  |  |
     extends                                        |  |  |  |  |
        |                                           v  v  v  v  v
+-------------------+    +-------------------+    +---------------+
| KeyObject 3  (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData |
+-------------------+    +-------------------+    +---------------+

Co-authored-by: Anna Henningsen <[email protected]>

PR-URL: #33360
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
codebytere added a commit that referenced this pull request Sep 28, 2020
Notable changes:

async_hooks:
  * add AsyncResource.bind utility (James M Snell) (#34574)
buffer:
  * also alias BigUInt methods (Anna Henningsen) (#34960)
  * alias UInt ➡️ Uint in buffer methods (Anna Henningsen) (#34729)
build:
  * add build flag for OSS-Fuzz integration (davkor) (#34761)
cli:
  * add alias for report-directory to make it consistent (Ash Cripps) (#33587)
crypto:
  * allow KeyObjects in postMessage (Tobias Nießen) (#33360)
  * add randomInt function (Oli Lalonde) (#34600)
deps:
  * upgrade to libuv 1.39.0 (Colin Ihrig) (#34915)
dgram:
  * add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) (#14500)
  * allow typed arrays in .send() (Sarat Addepalli) (#22413)
doc:
  * add basic embedding example documentation (Anna Henningsen) (#30467)
embedding:
  * make Stop() stop Workers (Anna Henningsen) (#32531)
  * provide hook for custom process.exit() behaviour (Anna Henningsen) (#32531)
fs:
  * implement lutimes (Maël Nison) (#33399)
http:
  * return this from IncomingMessage#destroy() (Colin Ihrig) (#32789)
  * expose host and protocol on ClientRequest (wenningplus) [#33803](#33803)
http2:
  * return this for Http2ServerRequest#setTimeout (Pranshu Srivastava) (#33994)
  * do not modify explicity set date headers (Pranshu Srivastava) (#33160)
* n-api**:
  * support type-tagging objects (Gabriel Schulhof) (#28237)
  * provide asynchronous cleanup hooks (Anna Henningsen) (#34572)
perf_hooks:
  * add idleTime and event loop util (Trevor Norris) (#34938)
timers:
  * allow timers to be used as primitives (Denys Otrishko) [#34017](#34017)
tls:
  * make 'createSecureContext' honor more options (Mateusz Krawczuk) (#33974)
worker:
  * add public method for marking objects as untransferable (Anna Henningsen) (#33979)
  * emit `'messagerror'` events for failed deserialization (Anna Henningsen) (#33772)
  * allow passing JS wrapper objects via postMessage (Anna Henningsen) (#33772)
  * allow transferring/cloning generic BaseObjects (Anna Henningsen) (#33772)
  * add option to track unmanaged file descriptors (Anna Henningsen) (#34303)
  * add stack size resource limit option (Anna Henningsen) (#33085)
  * make FileHandle transferable (Anna Henningsen) (#33772)
zlib:
  * add `maxOutputLength` option (unknown) (#33516)

PR-URL: TODO
@codebytere codebytere mentioned this pull request Sep 28, 2020
codebytere added a commit that referenced this pull request Oct 1, 2020
Notable changes:

async_hooks:
  * add AsyncResource.bind utility (James M Snell) (#34574)
buffer:
  * also alias BigUInt methods (Anna Henningsen) (#34960)
  * alias UInt ➡️ Uint in buffer methods (Anna Henningsen) (#34729)
build:
  * add build flag for OSS-Fuzz integration (davkor) (#34761)
cli:
  * add alias for report-directory to make it consistent (Ash Cripps) (#33587)
crypto:
  * allow KeyObjects in postMessage (Tobias Nießen) (#33360)
  * add randomInt function (Oli Lalonde) (#34600)
deps:
  * upgrade to libuv 1.39.0 (Colin Ihrig) (#34915)
dgram:
  * add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) (#14500)
  * allow typed arrays in .send() (Sarat Addepalli) (#22413)
doc:
  * add basic embedding example documentation (Anna Henningsen) (#30467)
embedding:
  * make Stop() stop Workers (Anna Henningsen) (#32531)
  * provide hook for custom process.exit() behaviour (Anna Henningsen) (#32531)
fs:
  * implement lutimes (Maël Nison) (#33399)
http:
  * return this from IncomingMessage#destroy() (Colin Ihrig) (#32789)
  * expose host and protocol on ClientRequest (wenningplus) [#33803](#33803)
http2:
  * return this for Http2ServerRequest#setTimeout (Pranshu Srivastava) (#33994)
  * do not modify explicity set date headers (Pranshu Srivastava) (#33160)
* n-api**:
  * support type-tagging objects (Gabriel Schulhof) (#28237)
  * provide asynchronous cleanup hooks (Anna Henningsen) (#34572)
perf_hooks:
  * add idleTime and event loop util (Trevor Norris) (#34938)
timers:
  * allow timers to be used as primitives (Denys Otrishko) [#34017](#34017)
tls:
  * make 'createSecureContext' honor more options (Mateusz Krawczuk) (#33974)
worker:
  * add public method for marking objects as untransferable (Anna Henningsen) (#33979)
  * emit `'messagerror'` events for failed deserialization (Anna Henningsen) (#33772)
  * allow passing JS wrapper objects via postMessage (Anna Henningsen) (#33772)
  * allow transferring/cloning generic BaseObjects (Anna Henningsen) (#33772)
  * add option to track unmanaged file descriptors (Anna Henningsen) (#34303)
  * add stack size resource limit option (Anna Henningsen) (#33085)
  * make FileHandle transferable (Anna Henningsen) (#33772)
zlib:
  * add `maxOutputLength` option (unknown) (#33516)

PR-URL: TODO
codebytere added a commit that referenced this pull request Oct 4, 2020
Notable changes:

assert:
  * (SEMVER-MINOR) port common.mustCall() to assert (ConorDavenport) #31982
async_hooks:
  * (SEMVER-MINOR) add AsyncResource.bind utility (James M Snell) #34574
buffer:
  * (SEMVER-MINOR) also alias BigUInt methods (Anna Henningsen) #34960
  * (SEMVER-MINOR) alias UInt ➡️ Uint in buffer methods (Anna Henningsen) #34729
build:
  * (SEMVER-MINOR) add build flag for OSS-Fuzz integration (davkor) #34761
cli:
  * (SEMVER-MINOR) add alias for report-directory to make it consistent (Ash Cripps) #33587
crypto:
  * (SEMVER-MINOR) allow KeyObjects in postMessage (Tobias Nießen) #33360
  * (SEMVER-MINOR) add randomInt function (Oli Lalonde) #34600
deps:
  * upgrade to libuv 1.39.0 (Colin Ihrig) #34915
  * upgrade npm to 6.14.7 (claudiahdz) #34468
  * upgrade to libuv 1.38.1 (Colin Ihrig) #34187
dgram:
  * (SEMVER-MINOR) add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) #14500
  * (SEMVER-MINOR) allow typed arrays in .send() (Sarat Addepalli) #22413
doc:
  * (SEMVER-MINOR) Add maxTotalSockets option to agent constructor (rickyes) #33617
  * (SEMVER-MINOR) add basic embedding example documentation (Anna Henningsen) #30467
  * add Ricky Zhou to collaborators (rickyes) #34676
  * add release key for Ruy Adorno (Ruy Adorno) #34628
  * add DerekNonGeneric to collaborators (Derek Lewis) #34602
  * add AshCripps to collaborators (Ash Cripps) #34494
  * add HarshithaKP to collaborators (Harshitha K P) #34417
  * add rexagod to collaborators (Pranshu Srivastava) #34457
  * add release key for Richard Lau (Richard Lau) #34397
  * add danielleadams to collaborators (Danielle Adams) #34360
  * add sxa as collaborator (Stewart X Addison) #34338
  * add ruyadorno to collaborators (Ruy Adorno) #34297
  * (SEMVER-MAJOR) deprecate process.umask() with no arguments (Colin Ihrig) #32499
embedding:
  * (SEMVER-MINOR) make Stop() stop Workers (Anna Henningsen) #32531
  * (SEMVER-MINOR) provide hook for custom process.exit() behaviour (Anna Henningsen) #32531
fs:
  * (SEMVER-MINOR) implement lutimes (Maël Nison) #33399
http:
  * (SEMVER-MINOR) add maxTotalSockets to agent class (rickyes) #33617
  * (SEMVER-MINOR) return this from IncomingMessage#destroy() (Colin Ihrig) #32789
  * (SEMVER-MINOR) expose host and protocol on ClientRequest (wenningplus) #33803
http2:
  * (SEMVER-MINOR) return this for Http2ServerRequest#setTimeout (Pranshu Srivastava) #33994
  * (SEMVER-MINOR) do not modify explicity set date headers (Pranshu Srivastava) #33160
module:
  * (SEMVER-MINOR) named exports for CJS via static analysis (Guy Bedford) #35249
  * (SEMVER-MINOR) exports pattern support (Guy Bedford) #34718
  * (SEMVER-MINOR) package "imports" field (Guy Bedford) #34117
  * (SEMVER-MINOR) deprecate module.parent (Antoine du HAMEL) #32217
n-api:
  * (SEMVER-MINOR) create N-API version 7 (Gabriel Schulhof) #35199
  * (SEMVER-MINOR) support type-tagging objects (Gabriel Schulhof) #28237
n-api,src:
  * (SEMVER-MINOR) provide asynchronous cleanup hooks (Anna Henningsen) #34572
perf_hooks:
  * (SEMVER-MINOR) add idleTime and event loop util (Trevor Norris) #34938
timers:
  * (SEMVER-MINOR) allow timers to be used as primitives (Denys Otrishko) #34017
tls:
  * (SEMVER-MINOR) make 'createSecureContext' honor more options (Mateusz Krawczuk) #33974
worker:
  * (SEMVER-MINOR) add public method for marking objects as untransferable (Anna Henningsen) #33979
  * (SEMVER-MINOR) emit `'messagerror'` events for failed deserialization (Anna Henningsen) #33772
  * (SEMVER-MINOR) allow passing JS wrapper objects via postMessage (Anna Henningsen) #33772
  * (SEMVER-MINOR) allow transferring/cloning generic BaseObjects (Anna Henningsen) #33772
  * (SEMVER-MINOR) add option to track unmanaged file descriptors (Anna Henningsen) #34303
  * (SEMVER-MINOR) add stack size resource limit option (Anna Henningsen) #33085
worker,fs:
  * (SEMVER-MINOR) make FileHandle transferable (Anna Henningsen) #33772
zlib:
  * (SEMVER-MINOR) add `maxOutputLength` option (unknown) #33516
  * switch to lazy init for zlib streams (Andrey Pechkurov) #34048

PR-URL: TODO
codebytere added a commit that referenced this pull request Oct 6, 2020
Notable changes:

assert:
  * (SEMVER-MINOR) port common.mustCall() to assert (ConorDavenport) #31982
async_hooks:
  * (SEMVER-MINOR) add AsyncResource.bind utility (James M Snell) #34574
buffer:
  * (SEMVER-MINOR) also alias BigUInt methods (Anna Henningsen) #34960
  * (SEMVER-MINOR) alias UInt ➡️ Uint in buffer methods (Anna Henningsen) #34729
build:
  * (SEMVER-MINOR) add build flag for OSS-Fuzz integration (davkor) #34761
cli:
  * (SEMVER-MINOR) add alias for report-directory to make it consistent (Ash Cripps) #33587
crypto:
  * (SEMVER-MINOR) allow KeyObjects in postMessage (Tobias Nießen) #33360
  * (SEMVER-MINOR) add randomInt function (Oli Lalonde) #34600
deps:
  * upgrade to libuv 1.39.0 (Colin Ihrig) #34915
  * upgrade npm to 6.14.7 (claudiahdz) #34468
  * upgrade to libuv 1.38.1 (Colin Ihrig) #34187
dgram:
  * (SEMVER-MINOR) add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) #14500
  * (SEMVER-MINOR) allow typed arrays in .send() (Sarat Addepalli) #22413
doc:
  * (SEMVER-MINOR) Add maxTotalSockets option to agent constructor (rickyes) #33617
  * (SEMVER-MINOR) add basic embedding example documentation (Anna Henningsen) #30467
  * add Ricky Zhou to collaborators (rickyes) #34676
  * add release key for Ruy Adorno (Ruy Adorno) #34628
  * add DerekNonGeneric to collaborators (Derek Lewis) #34602
  * add AshCripps to collaborators (Ash Cripps) #34494
  * add HarshithaKP to collaborators (Harshitha K P) #34417
  * add rexagod to collaborators (Pranshu Srivastava) #34457
  * add release key for Richard Lau (Richard Lau) #34397
  * add danielleadams to collaborators (Danielle Adams) #34360
  * add sxa as collaborator (Stewart X Addison) #34338
  * add ruyadorno to collaborators (Ruy Adorno) #34297
  * (SEMVER-MAJOR) deprecate process.umask() with no arguments (Colin Ihrig) #32499
embedding:
  * (SEMVER-MINOR) make Stop() stop Workers (Anna Henningsen) #32531
  * (SEMVER-MINOR) provide hook for custom process.exit() behaviour (Anna Henningsen) #32531
fs:
  * (SEMVER-MINOR) implement lutimes (Maël Nison) #33399
http:
  * (SEMVER-MINOR) add maxTotalSockets to agent class (rickyes) #33617
  * (SEMVER-MINOR) return this from IncomingMessage#destroy() (Colin Ihrig) #32789
  * (SEMVER-MINOR) expose host and protocol on ClientRequest (wenningplus) #33803
http2:
  * (SEMVER-MINOR) return this for Http2ServerRequest#setTimeout (Pranshu Srivastava) #33994
  * (SEMVER-MINOR) do not modify explicity set date headers (Pranshu Srivastava) #33160
module:
  * (SEMVER-MINOR) named exports for CJS via static analysis (Guy Bedford) #35249
  * (SEMVER-MINOR) exports pattern support (Guy Bedford) #34718
  * (SEMVER-MINOR) package "imports" field (Guy Bedford) #34117
  * (SEMVER-MINOR) deprecate module.parent (Antoine du HAMEL) #32217
n-api:
  * (SEMVER-MINOR) create N-API version 7 (Gabriel Schulhof) #35199
  * (SEMVER-MINOR) support type-tagging objects (Gabriel Schulhof) #28237
n-api,src:
  * (SEMVER-MINOR) provide asynchronous cleanup hooks (Anna Henningsen) #34572
perf_hooks:
  * (SEMVER-MINOR) add idleTime and event loop util (Trevor Norris) #34938
timers:
  * (SEMVER-MINOR) allow timers to be used as primitives (Denys Otrishko) #34017
tls:
  * (SEMVER-MINOR) make 'createSecureContext' honor more options (Mateusz Krawczuk) #33974
worker:
  * (SEMVER-MINOR) add public method for marking objects as untransferable (Anna Henningsen) #33979
  * (SEMVER-MINOR) emit `'messagerror'` events for failed deserialization (Anna Henningsen) #33772
  * (SEMVER-MINOR) allow passing JS wrapper objects via postMessage (Anna Henningsen) #33772
  * (SEMVER-MINOR) allow transferring/cloning generic BaseObjects (Anna Henningsen) #33772
  * (SEMVER-MINOR) add option to track unmanaged file descriptors (Anna Henningsen) #34303
  * (SEMVER-MINOR) add stack size resource limit option (Anna Henningsen) #33085
worker,fs:
  * (SEMVER-MINOR) make FileHandle transferable (Anna Henningsen) #33772
zlib:
  * (SEMVER-MINOR) add `maxOutputLength` option (unknown) #33516
  * switch to lazy init for zlib streams (Andrey Pechkurov) #34048

PR-URL: TODO
codebytere added a commit that referenced this pull request Oct 6, 2020
Notable changes:

assert:
  * (SEMVER-MINOR) port common.mustCall() to assert (ConorDavenport) #31982
async_hooks:
  * (SEMVER-MINOR) add AsyncResource.bind utility (James M Snell) #34574
buffer:
  * (SEMVER-MINOR) also alias BigUInt methods (Anna Henningsen) #34960
  * (SEMVER-MINOR) alias UInt ➡️ Uint in buffer methods (Anna Henningsen) #34729
build:
  * (SEMVER-MINOR) add build flag for OSS-Fuzz integration (davkor) #34761
cli:
  * (SEMVER-MINOR) add alias for report-directory to make it consistent (Ash Cripps) #33587
crypto:
  * (SEMVER-MINOR) allow KeyObjects in postMessage (Tobias Nießen) #33360
  * (SEMVER-MINOR) add randomInt function (Oli Lalonde) #34600
deps:
  * upgrade to libuv 1.39.0 (Colin Ihrig) #34915
  * upgrade npm to 6.14.7 (claudiahdz) #34468
  * upgrade to libuv 1.38.1 (Colin Ihrig) #34187
dgram:
  * (SEMVER-MINOR) add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) #14500
  * (SEMVER-MINOR) allow typed arrays in .send() (Sarat Addepalli) #22413
doc:
  * (SEMVER-MINOR) Add maxTotalSockets option to agent constructor (rickyes) #33617
  * (SEMVER-MINOR) add basic embedding example documentation (Anna Henningsen) #30467
  * add Ricky Zhou to collaborators (rickyes) #34676
  * add release key for Ruy Adorno (Ruy Adorno) #34628
  * add DerekNonGeneric to collaborators (Derek Lewis) #34602
  * add AshCripps to collaborators (Ash Cripps) #34494
  * add HarshithaKP to collaborators (Harshitha K P) #34417
  * add rexagod to collaborators (Pranshu Srivastava) #34457
  * add release key for Richard Lau (Richard Lau) #34397
  * add danielleadams to collaborators (Danielle Adams) #34360
  * add sxa as collaborator (Stewart X Addison) #34338
  * add ruyadorno to collaborators (Ruy Adorno) #34297
  * (SEMVER-MAJOR) deprecate process.umask() with no arguments (Colin Ihrig) #32499
embedding:
  * (SEMVER-MINOR) make Stop() stop Workers (Anna Henningsen) #32531
  * (SEMVER-MINOR) provide hook for custom process.exit() behaviour (Anna Henningsen) #32531
fs:
  * (SEMVER-MINOR) implement lutimes (Maël Nison) #33399
http:
  * (SEMVER-MINOR) add maxTotalSockets to agent class (rickyes) #33617
  * (SEMVER-MINOR) return this from IncomingMessage#destroy() (Colin Ihrig) #32789
  * (SEMVER-MINOR) expose host and protocol on ClientRequest (wenningplus) #33803
http2:
  * (SEMVER-MINOR) return this for Http2ServerRequest#setTimeout (Pranshu Srivastava) #33994
  * (SEMVER-MINOR) do not modify explicity set date headers (Pranshu Srivastava) #33160
module:
  * (SEMVER-MINOR) named exports for CJS via static analysis (Guy Bedford) #35249
  * (SEMVER-MINOR) exports pattern support (Guy Bedford) #34718
  * (SEMVER-MINOR) package "imports" field (Guy Bedford) #34117
  * (SEMVER-MINOR) deprecate module.parent (Antoine du HAMEL) #32217
n-api:
  * (SEMVER-MINOR) create N-API version 7 (Gabriel Schulhof) #35199
  * (SEMVER-MINOR) support type-tagging objects (Gabriel Schulhof) #28237
n-api,src:
  * (SEMVER-MINOR) provide asynchronous cleanup hooks (Anna Henningsen) #34572
perf_hooks:
  * (SEMVER-MINOR) add idleTime and event loop util (Trevor Norris) #34938
timers:
  * (SEMVER-MINOR) allow timers to be used as primitives (Denys Otrishko) #34017
tls:
  * (SEMVER-MINOR) make 'createSecureContext' honor more options (Mateusz Krawczuk) #33974
worker:
  * (SEMVER-MINOR) add public method for marking objects as untransferable (Anna Henningsen) #33979
  * (SEMVER-MINOR) emit `'messagerror'` events for failed deserialization (Anna Henningsen) #33772
  * (SEMVER-MINOR) allow passing JS wrapper objects via postMessage (Anna Henningsen) #33772
  * (SEMVER-MINOR) allow transferring/cloning generic BaseObjects (Anna Henningsen) #33772
  * (SEMVER-MINOR) add option to track unmanaged file descriptors (Anna Henningsen) #34303
  * (SEMVER-MINOR) add stack size resource limit option (Anna Henningsen) #33085
worker,fs:
  * (SEMVER-MINOR) make FileHandle transferable (Anna Henningsen) #33772
zlib:
  * (SEMVER-MINOR) add `maxOutputLength` option (unknown) #33516
  * switch to lazy init for zlib streams (Andrey Pechkurov) #34048

PR-URL: TODO
codebytere added a commit that referenced this pull request Oct 6, 2020
Notable changes:

assert:
  * (SEMVER-MINOR) port common.mustCall() to assert (ConorDavenport) #31982
async_hooks:
  * (SEMVER-MINOR) add AsyncResource.bind utility (James M Snell) #34574
buffer:
  * (SEMVER-MINOR) also alias BigUInt methods (Anna Henningsen) #34960
  * (SEMVER-MINOR) alias UInt ➡️ Uint in buffer methods (Anna Henningsen) #34729
build:
  * (SEMVER-MINOR) add build flag for OSS-Fuzz integration (davkor) #34761
cli:
  * (SEMVER-MINOR) add alias for report-directory to make it consistent (Ash Cripps) #33587
crypto:
  * (SEMVER-MINOR) allow KeyObjects in postMessage (Tobias Nießen) #33360
  * (SEMVER-MINOR) add randomInt function (Oli Lalonde) #34600
deps:
  * upgrade to libuv 1.39.0 (Colin Ihrig) #34915
  * upgrade npm to 6.14.7 (claudiahdz) #34468
  * upgrade to libuv 1.38.1 (Colin Ihrig) #34187
dgram:
  * (SEMVER-MINOR) add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) #14500
  * (SEMVER-MINOR) allow typed arrays in .send() (Sarat Addepalli) #22413
doc:
  * (SEMVER-MINOR) Add maxTotalSockets option to agent constructor (rickyes) #33617
  * (SEMVER-MINOR) add basic embedding example documentation (Anna Henningsen) #30467
  * add Ricky Zhou to collaborators (rickyes) #34676
  * add release key for Ruy Adorno (Ruy Adorno) #34628
  * add DerekNonGeneric to collaborators (Derek Lewis) #34602
  * add AshCripps to collaborators (Ash Cripps) #34494
  * add HarshithaKP to collaborators (Harshitha K P) #34417
  * add rexagod to collaborators (Pranshu Srivastava) #34457
  * add release key for Richard Lau (Richard Lau) #34397
  * add danielleadams to collaborators (Danielle Adams) #34360
  * add sxa as collaborator (Stewart X Addison) #34338
  * add ruyadorno to collaborators (Ruy Adorno) #34297
  * (SEMVER-MAJOR) deprecate process.umask() with no arguments (Colin Ihrig) #32499
embedding:
  * (SEMVER-MINOR) make Stop() stop Workers (Anna Henningsen) #32531
  * (SEMVER-MINOR) provide hook for custom process.exit() behaviour (Anna Henningsen) #32531
fs:
  * (SEMVER-MINOR) implement lutimes (Maël Nison) #33399
http:
  * (SEMVER-MINOR) add maxTotalSockets to agent class (rickyes) #33617
  * (SEMVER-MINOR) return this from IncomingMessage#destroy() (Colin Ihrig) #32789
  * (SEMVER-MINOR) expose host and protocol on ClientRequest (wenningplus) #33803
http2:
  * (SEMVER-MINOR) return this for Http2ServerRequest#setTimeout (Pranshu Srivastava) #33994
  * (SEMVER-MINOR) do not modify explicity set date headers (Pranshu Srivastava) #33160
module:
  * (SEMVER-MINOR) named exports for CJS via static analysis (Guy Bedford) #35249
  * (SEMVER-MINOR) exports pattern support (Guy Bedford) #34718
  * (SEMVER-MINOR) package "imports" field (Guy Bedford) #34117
  * (SEMVER-MINOR) deprecate module.parent (Antoine du HAMEL) #32217
n-api:
  * (SEMVER-MINOR) create N-API version 7 (Gabriel Schulhof) #35199
  * (SEMVER-MINOR) support type-tagging objects (Gabriel Schulhof) #28237
n-api,src:
  * (SEMVER-MINOR) provide asynchronous cleanup hooks (Anna Henningsen) #34572
perf_hooks:
  * (SEMVER-MINOR) add idleTime and event loop util (Trevor Norris) #34938
timers:
  * (SEMVER-MINOR) allow timers to be used as primitives (Denys Otrishko) #34017
tls:
  * (SEMVER-MINOR) make 'createSecureContext' honor more options (Mateusz Krawczuk) #33974
worker:
  * (SEMVER-MINOR) add public method for marking objects as untransferable (Anna Henningsen) #33979
  * (SEMVER-MINOR) emit `'messagerror'` events for failed deserialization (Anna Henningsen) #33772
  * (SEMVER-MINOR) allow passing JS wrapper objects via postMessage (Anna Henningsen) #33772
  * (SEMVER-MINOR) allow transferring/cloning generic BaseObjects (Anna Henningsen) #33772
  * (SEMVER-MINOR) add option to track unmanaged file descriptors (Anna Henningsen) #34303
  * (SEMVER-MINOR) add stack size resource limit option (Anna Henningsen) #33085
worker,fs:
  * (SEMVER-MINOR) make FileHandle transferable (Anna Henningsen) #33772
zlib:
  * (SEMVER-MINOR) add `maxOutputLength` option (unknown) #33516
  * switch to lazy init for zlib streams (Andrey Pechkurov) #34048

PR-URL: #35401
codebytere added a commit that referenced this pull request Oct 6, 2020
Notable changes:

assert:
  * (SEMVER-MINOR) port common.mustCall() to assert (ConorDavenport) #31982
async_hooks:
  * (SEMVER-MINOR) add AsyncResource.bind utility (James M Snell) #34574
buffer:
  * (SEMVER-MINOR) also alias BigUInt methods (Anna Henningsen) #34960
  * (SEMVER-MINOR) alias UInt ➡️ Uint in buffer methods (Anna Henningsen) #34729
build:
  * (SEMVER-MINOR) add build flag for OSS-Fuzz integration (davkor) #34761
cli:
  * (SEMVER-MINOR) add alias for report-directory to make it consistent (Ash Cripps) #33587
crypto:
  * (SEMVER-MINOR) allow KeyObjects in postMessage (Tobias Nießen) #33360
  * (SEMVER-MINOR) add randomInt function (Oli Lalonde) #34600
deps:
  * upgrade to libuv 1.39.0 (Colin Ihrig) #34915
  * upgrade npm to 6.14.7 (claudiahdz) #34468
  * upgrade to libuv 1.38.1 (Colin Ihrig) #34187
dgram:
  * (SEMVER-MINOR) add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) #14500
  * (SEMVER-MINOR) allow typed arrays in .send() (Sarat Addepalli) #22413
doc:
  * (SEMVER-MINOR) Add maxTotalSockets option to agent constructor (rickyes) #33617
  * (SEMVER-MINOR) add basic embedding example documentation (Anna Henningsen) #30467
  * add Ricky Zhou to collaborators (rickyes) #34676
  * add release key for Ruy Adorno (Ruy Adorno) #34628
  * add DerekNonGeneric to collaborators (Derek Lewis) #34602
  * add AshCripps to collaborators (Ash Cripps) #34494
  * add HarshithaKP to collaborators (Harshitha K P) #34417
  * add rexagod to collaborators (Pranshu Srivastava) #34457
  * add release key for Richard Lau (Richard Lau) #34397
  * add danielleadams to collaborators (Danielle Adams) #34360
  * add sxa as collaborator (Stewart X Addison) #34338
  * add ruyadorno to collaborators (Ruy Adorno) #34297
  * (SEMVER-MAJOR) deprecate process.umask() with no arguments (Colin Ihrig) #32499
embedding:
  * (SEMVER-MINOR) make Stop() stop Workers (Anna Henningsen) #32531
  * (SEMVER-MINOR) provide hook for custom process.exit() behaviour (Anna Henningsen) #32531
fs:
  * (SEMVER-MINOR) implement lutimes (Maël Nison) #33399
http:
  * (SEMVER-MINOR) add maxTotalSockets to agent class (rickyes) #33617
  * (SEMVER-MINOR) return this from IncomingMessage#destroy() (Colin Ihrig) #32789
  * (SEMVER-MINOR) expose host and protocol on ClientRequest (wenningplus) #33803
http2:
  * (SEMVER-MINOR) return this for Http2ServerRequest#setTimeout (Pranshu Srivastava) #33994
  * (SEMVER-MINOR) do not modify explicity set date headers (Pranshu Srivastava) #33160
module:
  * (SEMVER-MINOR) named exports for CJS via static analysis (Guy Bedford) #35249
  * (SEMVER-MINOR) exports pattern support (Guy Bedford) #34718
  * (SEMVER-MINOR) package "imports" field (Guy Bedford) #34117
  * (SEMVER-MINOR) deprecate module.parent (Antoine du HAMEL) #32217
n-api:
  * (SEMVER-MINOR) create N-API version 7 (Gabriel Schulhof) #35199
  * (SEMVER-MINOR) support type-tagging objects (Gabriel Schulhof) #28237
n-api,src:
  * (SEMVER-MINOR) provide asynchronous cleanup hooks (Anna Henningsen) #34572
perf_hooks:
  * (SEMVER-MINOR) add idleTime and event loop util (Trevor Norris) #34938
timers:
  * (SEMVER-MINOR) allow timers to be used as primitives (Denys Otrishko) #34017
tls:
  * (SEMVER-MINOR) make 'createSecureContext' honor more options (Mateusz Krawczuk) #33974
worker:
  * (SEMVER-MINOR) add public method for marking objects as untransferable (Anna Henningsen) #33979
  * (SEMVER-MINOR) emit `'messagerror'` events for failed deserialization (Anna Henningsen) #33772
  * (SEMVER-MINOR) allow passing JS wrapper objects via postMessage (Anna Henningsen) #33772
  * (SEMVER-MINOR) allow transferring/cloning generic BaseObjects (Anna Henningsen) #33772
  * (SEMVER-MINOR) add option to track unmanaged file descriptors (Anna Henningsen) #34303
  * (SEMVER-MINOR) add stack size resource limit option (Anna Henningsen) #33085
worker,fs:
  * (SEMVER-MINOR) make FileHandle transferable (Anna Henningsen) #33772
zlib:
  * (SEMVER-MINOR) add `maxOutputLength` option (unknown) #33516
  * switch to lazy init for zlib streams (Andrey Pechkurov) #34048

PR-URL: #35401
@jstewmon
Copy link

jstewmon commented Nov 9, 2020

👋 Hi, I don't have a simple reproduction yet, but I think this change has resulted in a memory leak where every instance inherited from NativeKeyObject is retained forever.

I noticed this in a production application which exhibits a clear memory leak on node 12.19.0 but not on node 12.18.4.

I've taken heap dumps of my application surrounding a few minutes of generated requests, and I can see that *KeyObject constructors are never being freed (these objects are constructed by my application at request time):
image

I'm not exactly an expert at using the snapshot analyzer, but I think Global handles is significant:
image

I can also locate these object in the Containment view at (GC roots) -> (Global handles).

For context, my application is experiencing this when using the jose package to format JWKs - the key objects are created using the create* functions from crypto: https://unpkg.com/[email protected]/lib/help/key_object.js

@panva
Copy link
Member

panva commented Nov 9, 2020

@addaleax, @tniessen is this what #35481 was about? In that case, should it be backported and part of 12.20.0?

@jstewmon
Copy link

jstewmon commented Nov 9, 2020

@panva, thanks for the issue reference. The fix you mentioned was released in v14.13.1, and I confirmed the leak does not reproduce on v14.15.0.

@addaleax
Copy link
Member

addaleax commented Nov 9, 2020

@panva @jstewmon Yes, exactly 👍

@addaleax addaleax mentioned this pull request Nov 9, 2020
joesepi pushed a commit to joesepi/node that referenced this pull request Jan 8, 2021
Notable changes:

assert:
  * (SEMVER-MINOR) port common.mustCall() to assert (ConorDavenport) nodejs#31982
async_hooks:
  * (SEMVER-MINOR) add AsyncResource.bind utility (James M Snell) nodejs#34574
buffer:
  * (SEMVER-MINOR) also alias BigUInt methods (Anna Henningsen) nodejs#34960
  * (SEMVER-MINOR) alias UInt ➡️ Uint in buffer methods (Anna Henningsen) nodejs#34729
build:
  * (SEMVER-MINOR) add build flag for OSS-Fuzz integration (davkor) nodejs#34761
cli:
  * (SEMVER-MINOR) add alias for report-directory to make it consistent (Ash Cripps) nodejs#33587
crypto:
  * (SEMVER-MINOR) allow KeyObjects in postMessage (Tobias Nießen) nodejs#33360
  * (SEMVER-MINOR) add randomInt function (Oli Lalonde) nodejs#34600
deps:
  * upgrade to libuv 1.39.0 (Colin Ihrig) nodejs#34915
  * upgrade npm to 6.14.7 (claudiahdz) nodejs#34468
  * upgrade to libuv 1.38.1 (Colin Ihrig) nodejs#34187
dgram:
  * (SEMVER-MINOR) add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) nodejs#14500
  * (SEMVER-MINOR) allow typed arrays in .send() (Sarat Addepalli) nodejs#22413
doc:
  * (SEMVER-MINOR) Add maxTotalSockets option to agent constructor (rickyes) nodejs#33617
  * (SEMVER-MINOR) add basic embedding example documentation (Anna Henningsen) nodejs#30467
  * add Ricky Zhou to collaborators (rickyes) nodejs#34676
  * add release key for Ruy Adorno (Ruy Adorno) nodejs#34628
  * add DerekNonGeneric to collaborators (Derek Lewis) nodejs#34602
  * add AshCripps to collaborators (Ash Cripps) nodejs#34494
  * add HarshithaKP to collaborators (Harshitha K P) nodejs#34417
  * add rexagod to collaborators (Pranshu Srivastava) nodejs#34457
  * add release key for Richard Lau (Richard Lau) nodejs#34397
  * add danielleadams to collaborators (Danielle Adams) nodejs#34360
  * add sxa as collaborator (Stewart X Addison) nodejs#34338
  * add ruyadorno to collaborators (Ruy Adorno) nodejs#34297
  * (SEMVER-MAJOR) deprecate process.umask() with no arguments (Colin Ihrig) nodejs#32499
embedding:
  * (SEMVER-MINOR) make Stop() stop Workers (Anna Henningsen) nodejs#32531
  * (SEMVER-MINOR) provide hook for custom process.exit() behaviour (Anna Henningsen) nodejs#32531
fs:
  * (SEMVER-MINOR) implement lutimes (Maël Nison) nodejs#33399
http:
  * (SEMVER-MINOR) add maxTotalSockets to agent class (rickyes) nodejs#33617
  * (SEMVER-MINOR) return this from IncomingMessage#destroy() (Colin Ihrig) nodejs#32789
  * (SEMVER-MINOR) expose host and protocol on ClientRequest (wenningplus) nodejs#33803
http2:
  * (SEMVER-MINOR) return this for Http2ServerRequest#setTimeout (Pranshu Srivastava) nodejs#33994
  * (SEMVER-MINOR) do not modify explicity set date headers (Pranshu Srivastava) nodejs#33160
module:
  * (SEMVER-MINOR) named exports for CJS via static analysis (Guy Bedford) nodejs#35249
  * (SEMVER-MINOR) exports pattern support (Guy Bedford) nodejs#34718
  * (SEMVER-MINOR) package "imports" field (Guy Bedford) nodejs#34117
  * (SEMVER-MINOR) deprecate module.parent (Antoine du HAMEL) nodejs#32217
n-api:
  * (SEMVER-MINOR) create N-API version 7 (Gabriel Schulhof) nodejs#35199
  * (SEMVER-MINOR) support type-tagging objects (Gabriel Schulhof) nodejs#28237
n-api,src:
  * (SEMVER-MINOR) provide asynchronous cleanup hooks (Anna Henningsen) nodejs#34572
perf_hooks:
  * (SEMVER-MINOR) add idleTime and event loop util (Trevor Norris) nodejs#34938
timers:
  * (SEMVER-MINOR) allow timers to be used as primitives (Denys Otrishko) nodejs#34017
tls:
  * (SEMVER-MINOR) make 'createSecureContext' honor more options (Mateusz Krawczuk) nodejs#33974
worker:
  * (SEMVER-MINOR) add public method for marking objects as untransferable (Anna Henningsen) nodejs#33979
  * (SEMVER-MINOR) emit `'messagerror'` events for failed deserialization (Anna Henningsen) nodejs#33772
  * (SEMVER-MINOR) allow passing JS wrapper objects via postMessage (Anna Henningsen) nodejs#33772
  * (SEMVER-MINOR) allow transferring/cloning generic BaseObjects (Anna Henningsen) nodejs#33772
  * (SEMVER-MINOR) add option to track unmanaged file descriptors (Anna Henningsen) nodejs#34303
  * (SEMVER-MINOR) add stack size resource limit option (Anna Henningsen) nodejs#33085
worker,fs:
  * (SEMVER-MINOR) make FileHandle transferable (Anna Henningsen) nodejs#33772
zlib:
  * (SEMVER-MINOR) add `maxOutputLength` option (unknown) nodejs#33516
  * switch to lazy init for zlib streams (Andrey Pechkurov) nodejs#34048

PR-URL: nodejs#35401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. lib / src Issues and PRs related to general changes in the lib or src directory. semver-minor PRs that contain new features and should be released in the next minor version. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants